<?php
/*
 * @author Donald Barclay
 * @created March 24 2014
 * 
 * A class that represents a 15 min block of time
 */
class timeSlot{
    private $timeSlotID;//Unique ID
    private $clincians;//Array of clinicians with appointments available in this shift
    private $shiftCount;//Counter that keeps track of the ammount of appointments in a shift
    private $timeStamp;//String representing the time of the timeSlot
    private $appointments;//Array of appointments in a timeslot
}

function _construct($tsid,$time){
    $this -> timeSlotID = $tsid;
    $this -> timeStamp = $time;
    $this -> shiftCount = 0;
    $this -> clinicians = array();
    $this -> appointments = array();
}
/*
 * Set Methods
 * Not all fields are set methods --- a good bunch of info is set in addNewClinician()
 */
function setTimeSlotID($tsid){
    $this -> timeSlotID = $tsid;
}
function setTimeStamp($time){
    $this -> timeSlotID = $time;
}
/*
 * Basic get methods
 */
function getTimeSlotID(){
    return $this -> timeSlotID;
}
function getTimeStamp(){
    return $this -> timeStamp;
}
function getClinicans(){
    return $this -> clinicians;
}
function getAppointments(){
    return $this -> appointments;
}
function getShiftCount(){
    return $this -> shiftCount;
}

/*
 * Function that:
 * adds a clinician to a time slot's array of clincians working that shift
 * creates a new appointment based on a clinicians ability to staff that shift
 */
function registerClincianShift($cid,$specialty){
    $tempShiftCount = $this -> getShiftCount();
    $this -> clinicians[$tempShiftCount] = $cid;
    
        $newAppointment = new Appointment(0,$cid,null,$specialty,$this->timeStamp);//We need to figure out how to keep track of primary keys
        $this -> appointments [$tempShiftCount] = $newAppointment;
        
   $this -> shiftCount = $this -> shiftCount + 1;            

}

